
import request from '@/utils/request'


/**查询采购单装箱序列号列表 */
export function getBatchSerByPurchase(params) {
  return request({
    url: '/distribution/batch/getBatchSerByPurchase',
    params
  })
}


/**查询供应商厂家信息 */
export function getManufacturersByDis(params) {
  return request({
    url: '/distribution/purchase/getManufacturersByDis',
    params
  })
}



/**供应商修改采购单信息 */
export function updateDisPurchase(data) {
  return request({
    url: '/distribution/purchase/updateDisPurchase',
    method: 'post',
    data
  })
}


/**获取sku最近采购列表 */
export function getSkuPurchaseList(params) {
  return request({
    url: '/distribution/sku/getSkuPurchaseList',
    params
  })
}

/**修改产品链接 */
export function updateManufacturersSkuUrl(data) {
  return request({
    url: '/distribution/manufacturersSku/updateManufacturersSkuUrl',
    method: 'post',
    data
  })
}

/**仓库采购单操作退款 */
export function confirmRefund(data) {
  return request({
    url: '/distribution/purchase/confirmRefund',
    method: 'post',
    data
  })
}

/**审核采购单 */
export function checkPurchase(data) {
  return request({
    url: '/distribution/purchase/checkPurchase',
    method: 'post',
    data
  })
}
/**采购时选择厂家查询关联的SKU */
export function getManufacturersSkuListByPurchase(params) {
  return request({
    url: '/distribution/manufacturers/getManufacturersSkuListByPurchase',
    params
  })
}

/**查询已采购厂家列表 */
export function getManufacturers(params) {
  return request({
    url: '/distribution/manufacturers/getManufacturers',
    params
  })
}

/**查询已采购厂家列表 */
export function getManufacturersListOld(skuId) {
  return request({
    url: '/distribution/manufacturers/getManufacturersListOld',
    params: { skuId }
  })
}

/**查询供应厂家列表 */
export function getManufacturerList(query) {
  return request({
    url: '/distribution/manufacturers/getManufacturerList',
    method: 'get',
    params: query
  })
}


/**删除采购单*/
export function deletePurchase(ids) {
  return request({
    url: `/distribution/purchase/${ids}`,
    method: 'delete'
  })
}


/**查询汇率（每天更新）列表*/
export function getConversionRateList(id) {
  return request({
    url: `/distribution/conversionRate/getConversionRateList`,
  })
}

/**获取采购详细信息*/
export function getPurchaseInfo(id) {
  return request({
    url: `/distribution/purchase/getInfo/${id}`,
  })
}

/**查询采购单列表-供应商 */
export function getPurchaseListByDistributor(params) {
  return request({
    url: '/distribution/purchase/getPurchaseListByDistributor',
    params
  })
}


/**获取sku列表  不分页  远程搜索*/
export function getSkuList(skuNo) {
  return request({
    url: `/distribution/sku/getSkuListNoPage`,
    params: { skuNo }
  })
}

/**创建采购单-酒水采购（预留接口） */
export function createPurchaseOrderJs(data) {
  return request({
    url: '/distribution/purchase/createPurchaseOrderJs',
    method: 'post',
    data,
    headers: {
      loading: true,
    }
  })
}

/**创建采购单-日本当地采购*/
export function createPurchaseOrderJp(data) {
  return request({
    url: '/distribution/purchase/createPurchaseOrderJp',
    method: 'post',
    data,
    headers: {
      loading: true,
    }
  })
}

/**创建采购单-国内 */
export function createPurchaseOrderCn(data) {
  return request({
    url: '/distribution/purchase/createPurchaseOrderJp',
    method: 'post',
    data,
    headers: {
      loading: true,
    }
  })
}



/**修改采购单 */
export function updatePurchase(data) {
  return request({
    url: '/distribution/purchase/updatePurchase',
    method: 'post',
    data
  })
}


/**强制修改采购信息（二改） */

export function setPurchaseInfo(data) {
  return request({
    url: '/distribution/purchase/setPurchaseInfo',
    method: 'post',
    data
  })
}

/**强制修改采购信息（二改） */

export function setPurchaseRefundInfo(data) {
  return request({
    url: '/distribution/purchase/setPurchaseRefundInfo',
    method: 'post',
    data
  })
}
/**采购单撤销审核 */
export function cancelApply(data) {
  return request({
    url: '/distribution/purchase/cancelApply',
    method: 'post',
    data
  })
}
